package com.xxbb.chapter_6.dome2;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Program {
    public static void main(String[] args) {
        //获取当前时间
        Calendar calendar= Calendar.getInstance();
        Date nowDate=calendar.getTime();
        SimpleDateFormat format= (SimpleDateFormat) SimpleDateFormat.getInstance();
        format.applyPattern("yyyy-MM-dd HH:mm:ss");
        System.out.println(format.format(nowDate));
    }
}
